package com.tech.framework.pay.consumer;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.alibaba.dubbo.config.annotation.Reference;
import com.tech.framework.zmpay.IThirdPay;

/**
 * 
 * @author fattiger.xiaoyang
 * @Date 2015年11月17日下午2:55:00
 */
public class ThirdPayConsumer {
	
	@Reference(version="1.0")
	private IThirdPay thirdPay;

	public void setThirdPay(IThirdPay thirdPay) {
		this.thirdPay = thirdPay;
	}

	public void getPayHtml() throws Exception{
		String message = "fattiger,I love you.";
		for (int i = 0; i < Integer.MAX_VALUE; i ++) {
            try {
        		System.out.println("["+ new SimpleDateFormat("HH:mm:ss").format(new Date())+ "] " + thirdPay.createPayHtml(message));
            } catch (Exception e) {
                e.printStackTrace();
            }
            Thread.sleep(2000);
        }
	}
}
